<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
		<!-- 重启浏览器，计数器会置1。这是因为session对象将浏览器的开启关闭作为一个周期 -->
		测试计数器的页面
		<%
		 if(session.getAttribute("counter") == null)
		 {
		 session.setAttribute("counter", "1");
		 }
		 else
		 {
		 String strnum = null;
		 strnum = session.getAttribute("counter").toString();
		 int icount = 0;
		 icount = Integer.valueOf(strnum).intValue();
		 icount++;
		 session.setAttribute("counter", Integer.toString(icount));
		 }
		 %>
		 您是第<%=session.getAttribute("counter") %>位访问者！
</body>
</html>